<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model backend\models\JjrUserCommission */

$this->title = '查看佣金';
$this->params['breadcrumbs'][] = ['label' => 'Jjr User Commissions', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="jjr-user-commission-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('修改', ['update', 'id' => $model['id']], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('删除', ['delete', 'id' => $model['id']], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',

           [ 'attribute'=>'real_name','label'=>'经纪人'],
            [ 'attribute'=>'name','label'=>'项目名称'],
            [ 'attribute'=>'client_real_name','label'=>'客户名称'],
           // 'jjr_user_project_id',
            [ 'attribute'=>'amount','label'=>'金额'],
            [ 'attribute'=>'transfer_status','label'=>'结佣状态','value'=>function($model){
                if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_NOT_START){
                    return '未结佣';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_STARTED){
                    return '结佣中';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_END){
                    return '已结佣';
                }else if($model['transfer_status']==\backend\models\JjrUserCommission::TRANSFER_FAIL){
                    return '结佣失败';
                }
            }],

            [ 'attribute'=>'create_time','label'=>'创建时间'],
            [ 'attribute'=>'update_time','label'=>'更新时间'],
            //'update_time',
           // 'status',

        ],
    ]) ?>

</div>

<!-- 定义数据块 -->
<?php $this->beginBlock('test'); ?>
jQuery(document).ready(function() {
highlight_subnav('jjr-user-commission/index'); //子导航高亮
});
<?php $this->endBlock() ?>
<!-- 将数据块 注入到视图中的某个位置 -->
<?php $this->registerJs($this->blocks['test'], \yii\web\View::POS_END); ?>
